3.157 \(\int \frac{\sec ^2(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx\)

Optimal. Leaf size=31 \[ \frac{\tanh ^{-1}(\sin (c+d x))}{a d}-\frac{i \sec (c+d x)}{a d} \]

[Out]

ArcTanh[Sin[c + d*x]]/(a*d) - (I*Sec[c + d*x])/(a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0943114, antiderivative size = 31, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.161, Rules used = {3092, 3090, 3770, 2606, 8} \[ \frac{\tanh ^{-1}(\sin (c+d x))}{a d}-\frac{i \sec (c+d x)}{a d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

ArcTanh[Sin[c + d*x]]/(a*d) - (I*Sec[c + d*x])/(a*d)

Rule 3092

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[a^n*b^n, Int[Cos[c + d*x]^m/(b*Cos[c + d*x] + a*Sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, m},
x] && EqQ[a^2 + b^2, 0] && ILtQ[n, 0]

Rule 3090

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[cos[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\sec ^2(c+d x)}{a \cos (c+d x)+i a \sin (c+d x)} \, dx &=-\frac{i \int \sec ^2(c+d x) (i a \cos (c+d x)+a \sin (c+d x)) \, dx}{a^2}\\ &=-\frac{i \int (i a \sec (c+d x)+a \sec (c+d x) \tan (c+d x)) \, dx}{a^2}\\ &=-\frac{i \int \sec (c+d x) \tan (c+d x) \, dx}{a}+\frac{\int \sec (c+d x) \, dx}{a}\\ &=\frac{\tanh ^{-1}(\sin (c+d x))}{a d}-\frac{i \operatorname{Subst}(\int 1 \, dx,x,\sec (c+d x))}{a d}\\ &=\frac{\tanh ^{-1}(\sin (c+d x))}{a d}-\frac{i \sec (c+d x)}{a d}\\ \end{align*}

Mathematica [A]  time = 0.193977, size = 35, normalized size = 1.13 \[ -\frac{i \left (\sec (c+d x)+2 i \tanh ^{-1}\left (\cos (c) \tan \left (\frac{d x}{2}\right )+\sin (c)\right )\right )}{a d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2/(a*Cos[c + d*x] + I*a*Sin[c + d*x]),x]

[Out]

((-I)*((2*I)*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x)/2]] + Sec[c + d*x]))/(a*d)

________________________________________________________________________________________

Maple [B]  time = 0.145, size = 85, normalized size = 2.7 \begin{align*}{\frac{-i}{ad} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) ^{-1}}+{\frac{1}{ad}\ln \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) }+{\frac{i}{ad} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) ^{-1}}-{\frac{1}{ad}\ln \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

-I/d/a/(tan(1/2*d*x+1/2*c)+1)+1/d/a*ln(tan(1/2*d*x+1/2*c)+1)+I/d/a/(tan(1/2*d*x+1/2*c)-1)-1/d/a*ln(tan(1/2*d*x
+1/2*c)-1)

________________________________________________________________________________________

Maxima [B]  time = 1.17606, size = 112, normalized size = 3.61 \begin{align*} \frac{\frac{\log \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac{\log \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac{2}{-i \, a + \frac{i \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="maxima")

[Out]

(log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a - 2/(-I*a + I*a*sin(d
*x + c)^2/(cos(d*x + c) + 1)^2))/d

________________________________________________________________________________________

Fricas [B]  time = 0.474333, size = 217, normalized size = 7. \begin{align*} \frac{{\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) -{\left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right ) - 2 i \, e^{\left (i \, d x + i \, c\right )}}{a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="fricas")

[Out]

((e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) + I) - (e^(2*I*d*x + 2*I*c) + 1)*log(e^(I*d*x + I*c) - I) - 2*I
*e^(I*d*x + I*c))/(a*d*e^(2*I*d*x + 2*I*c) + a*d)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2/(a*cos(d*x+c)+I*a*sin(d*x+c)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.15208, size = 81, normalized size = 2.61 \begin{align*} \frac{\frac{\log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac{\log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right )}{a} + \frac{2 i}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1\right )} a}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2/(a*cos(d*x+c)+I*a*sin(d*x+c)),x, algorithm="giac")

[Out]

(log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - log(abs(tan(1/2*d*x + 1/2*c) - 1))/a + 2*I/((tan(1/2*d*x + 1/2*c)^2 -
1)*a))/d